int f( unsigned int n )

{

    int FibN, FibNOne, FibNTwo;

    int i;

    int result[2] = { 0, 1 };

    if( n < 2 )

        return result[n];

    FibNOne = 0;

    FibNTwo = 1;

    FibN = 0;

    for( i = 2; i <= n; i++ )

    {                                                 

        FibN = FibNOne + FibNTwo;        

        FibNOne = FibNTwo;                 

        FibNTwo = FibN;                       

    }

    return FibN;
}
int main()
{
        int t=0;
        int i=0;
        scanf("%d",&t);
        int a[t];
        for(i=0;i<t;i++)
        {
                scanf("%d",&a[i]);
        }
        for(i=0;i<t;i++)
        {
                printf("%d\n",f(a[i]));
        }
        return 0;
}
